import path from 'path';
import { ConnectionOptions } from 'typeorm';
import { TcUsers } from './models/users';
import { TcContents } from './models/contents';

export const listen: number = 3000;

export const database: ConnectionOptions = {
  type: 'mysql',
  host: 'localhost',
  port: 3306,
  username: 'root',
  password: 'root',
  database: 'test_db',
  synchronize: true,
  logging: false,
  entities: [TcUsers, TcContents],
};

export const rootPath = function(p: string = ''): string {
  return path.resolve(__dirname, '../', p);
};
